using System.Drawing;
using System.Text;

namespace SGV
{
	public class RealMethods
	{
		public void  CreateDailyTasks()
		{
			SqlUtils.Execute("Select * From People");
			string data = null;
			string otherData = "";
			string someOtherDataObject = null;

			int ct = 20;
			SqlUtils.ExecuteUpdate("Update tbl_record Set Record_Subpoena = 1 where substring(Record_Patient,1,1) = '*' and    tbl_Record.Record_Type='BBILL' and     tbl_Record.record_status = 'Data Captured'  ");
			string jjD = "fred";
			if (ct == 150)
			{

				if (jjD == "rpfll")
				{
					data = "Bar Data\nLarge";
				}
				else
				{
					data = "Bar Data\nSmall";
				}
				jjD = "Fubar.HelpingReport.2011.rdlc";
			}
			else
			{
			SqlUtils.ExecuteUpdate("Update tbl_record set record_reqno2 =  (SELECT RTRIM(SUBSTRING(a.Record_Patient, CHARINDEX('yrsx', a.Record_Patient) + 4, 2)))  FROM tbl_Record a  WHERE  (a.Record_Patient LIKE '%yrsx%')  AND  ( isnumeric(SUBSTRING(a.Record_Patient, CHARINDEX('yrsx', a.Record_Patient) + 4, 1 )) = 1)  and  a.record_status = 'Data Captured' ");
				if (jjD == "rpfll")
				{
					otherData = "Pie Data\nLarge";
				}
				else
				{
					someOtherDataObject = "Pie Data\nSmall";
				}
			}
			SqlUtils.ExecuteUpdate("Update tbl_record set record_patient =  (SELECT SUBSTRING(a.Record_Patient, 0, CHARINDEX('yrsx', a.Record_Patient))) FROM tbl_Record a WHERE (a.Record_Patient LIKE '%yrsx%') AND (isnumeric(SUBSTRING(a.Record_Patient, CHARINDEX('yrsx', a.Record_Patient) + 4, 1)) = 1)   and  a.record_status = 'Data Captured' ");

			if (ct == 150)
			{
				// BUG445: Org rep team missing req chart
				if (jjD == "splitdisplay")
				{
				}
				else
				{
				}
				otherData = "Fubar.JeersReport.2011.rdlc";

			}
			else
			{
				StringFormat stringFormat = new StringFormat();
				RectangleF boundingRect;

			SqlUtils.ExecuteUpdate("Update tbl_record Set Record_WComp = 1 where (Record_PatientID LIKE '%WC%' OR Record_PatientID LIKE '%Work Comp%' OR Record_PatientID LIKE '%W Comp%' OR Record_PatientID LIKE '%Workmans Comp%'  OR Record_PatientID LIKE '%W/C%')  AND     tbl_Record.Record_Type='BBILL' and     tbl_Record.record_status = 'Data Captured' ");
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Center;

				if (otherData != "")
				{
					if (otherData == "")
					{
						otherData = @"  //{
                g.Dispose();
                //    boundingRect = new RectangleF(50, 100, 320, 320);
                //    g.DrawString(otherData, new Font('Cooper Black', 40), new SolidBrush(Color.White), boundingRect, stringFormat);
                //}";
						otherData = "Fubar.MailingReport.2011.rdlc";

						StringBuilder x = new StringBuilder(50000);
						for (int i = 0; i < 20; i++)
						{
							x.Append(char.ToUpper(otherData[i]));
						}
					}
					boundingRect = new RectangleF(50, 100, 320, 320);
				}
				else
				{
					boundingRect = new RectangleF(50, 100, 160, 160);
				}

				// Todo: We might need this back after the conference
				//StringFormat stringFormat = new StringFormat();
				//RectangleF boundingRect;

				//stringFormat.Alignment = StringAlignment.Center;
				//stringFormat.LineAlignment = StringAlignment.Center;

			SqlUtils.ExecuteUpdate("Update tbl_record Set Record_OGDocs = 1 where (Record_Patient LIKE '%DOCS%')  AND     tbl_Record.Record_Type='BBILL' and     tbl_Record.record_status = 'Data Captured' ");
				//if (otherData != "")
				//{
				//    boundingRect = new RectangleF(50, 100, 320, 320);
				//    g.DrawString(otherData, new Font("Cooper Black", 40), new SolidBrush(Color.White), boundingRect, stringFormat);
				//}
				//else
				//{
				//    boundingRect = new RectangleF(50, 100, 160, 160);
				//    g.DrawString(someOtherDataObject, new Font("Cooper Black", 20), new SolidBrush(Color.White), boundingRect, stringFormat);
				//}
			}
			SqlUtils.ExecuteUpdate("Update tbl_record Set Record_MicroFilm = 1 where (Record_PatientID LIKE '%MICR%')  AND     tbl_Record.Record_Type='BBILL' and     tbl_Record.record_status = 'Data Captured' ");
		}
	}
}